package com.onluy.frameworkcloud.tools.utils;

import org.apache.commons.lang3.RandomStringUtils;

public class RandomNumberUtil {
    private static final char[] NUMBER_ARR = {'1','2','3','4','5','6','7','8','9','0'};

    public static String genRandomNumber(int width) {
        if (width <= 0) {
            throw new IllegalArgumentException("随机串长度不能小于0");
        }
        return RandomStringUtils.random(width, NUMBER_ARR);
    }
}
